import { Request, Response } from 'express';

// mock tableListDataSource
const dataSource: any[] = [];

for (let i = 0; i < 10; i += 1) {
  dataSource.push({
    key: i,
    id: 123456 + i,
    batchId: 123 + 1,
    logisName: '北京科技大学',
    expressName: '顺丰快递',
    batchDate: '2020-1-1 12:12:12',
    seqNo: '1-1',
    scanCount: 20,
    deliveredCount: 50,
    paymentAmount: 30,
    updateTime: '2020-1-1 12:12:12',
    statusName: '正常',
  });
}

function getBatchList(req: Request, res: Response, u: string) {
  const result = {
    code: 0,
    message: 'success',
    body: {
      count: 56,
      list: dataSource,
    },
  };

  return res.json(result);
}

export default {
  'GET /batch/list': getBatchList,
};
